/**
 * Created by hms on 2020-08-20.
 */
import { getMenu,editAccount } from '../api/menu.js'

export const Menu = {
    state:{
        menulist:[],
        slider_open:false
    },
    mutations:{
        setMenuList(state,menulist){
            state.menulist=menulist;
        },
        setSliderStatus(state,status){
            state.slider_open=status;
        }
    },
    actions:{
        loadMenuList(context,data){
            getMenu(data).then(function(response){
                context.commit('setMenuList',response.data.list);
            })
        },
        loadSliderStatus(context,data){
           context.commit('setSliderStatus',data);
        }
    },
    getters:{
        getMenuList:state=>{
           return state.menulist;
        },
        getSliderStatus:state => {
           return state.slider_open;
        }
    }
}
